/*
 * TrackerSD.cc
 *
 *  Created on: 14.04.2011
 *      Author: ed
 */

#include "TrackerSD.hh"
#include "globals.hh"
#include "G4VProcess.hh"
#include "PrimariesGenerator.hh"
TrackerSD::TrackerSD(G4String name) : G4VSensitiveDetector(name){}

TrackerSD::~TrackerSD() {}
bool TrackerSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
{
	/*G4cout<<aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()<<G4endl;
	G4cout<<aStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName()<<G4endl;*/
	/*if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Air Box")
	{
		lightOutput++;
	}*/
	//G4cout<<aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName()<<G4endl;
	lightOutput++;
	return true;
}
void TrackerSD::Initialize(G4HCofThisEvent*)
{
	lightOutput = 0;
	particlesPerEvent = PrimariesGenerator::GetNParticlesPerEvent();
}
void TrackerSD::EndOfEvent(G4HCofThisEvent*)
{
	G4cout<<lightOutput<<G4endl;
}
